﻿@************************************************************************************//
// Autor:  		Adrian Di Puglia       							     				*//
//***********************************************************************************//
// Edit()	Acceso solo ADMINISTRADOR												*//
// Vista que devuelve la planilla que permite editar un Usuario especificado.		*//
// _________________________________________________________________________________*@
@model File_Manager.Models.ParentModelViewUser
           
@{
    ViewBag.Title = "Editar";
}
<script type="text/javascript">
    disablePar(['#UserModel_UserName', '#UserModel_CreationDate', '#UserModel_LastLoginDate', '#User_I_parent_cedula', '#User_I_n_cuotas_pago','#User_I_n_transaction', '#User_I_n_transaction02', '#User_I_n_transaction03', '#User_I_transactionDate', '#User_I_transactionDate02', '#User_I_transactionDate03', '#User_I_verificado', '#User_I_verificado02', '#User_I_verificado03']);
    disableParDropList(['#idModoPago', '#idFormaPago', '#idFormaPago02', '#idFormaPago03']);
</script>

<h2>Editar</h2>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true, "Modificación de cuenta invalida. Corregir errores y volver a intentar.")

    @*Html.Hidden("idRolOLD");*@
    @Html.HiddenFor(m => m.User_I.registerDate)                           
                            
 <fieldset>
        <legend>Datos del Estudiante</legend><br />
            <table width= "100%">
                <tr>
                    <td>
                        <div class="editor-label">
                            (*) @Html.LabelFor(m => m.User_I.name)
                        </div>
                        <div class="editor-field">
                            @Html.EditorFor(m => m.User_I.name)<br />
                            @Html.ValidationMessageFor(m => m.User_I.name)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            (*) @Html.LabelFor(m => m.User_I.last_name)
                        </div>
                        <div class="editor-field">
                            @Html.EditorFor(m => m.User_I.last_name)<br />
                            @Html.ValidationMessageFor(m => m.User_I.last_name)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(m => m.UserModel.UserName)
                        </div>
                        <div class="editor-field">
                            @Html.EditorFor(m => m.UserModel.UserName)<br />
                            @Html.ValidationMessageFor(m => m.UserModel.UserName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            (*) @Html.LabelFor(m => m.User_I.phone)
                        </div>
                        <div class="editor-field">
                            @Html.EditorFor(m => m.User_I.phone)<br />
                            @Html.ValidationMessageFor(m => m.User_I.phone)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            (*) @Html.LabelFor(m => m.User_I.idStatus)
                        </div>
                        <div class="editor-field">
                            @Html.DropDownList("idStatus")<br />
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            (*) @Html.LabelFor(m => m.UserModel.Email)
                        </div>
                        <div class="editor-field">
                            @Html.EditorFor(m => m.UserModel.Email)<br />
                            @Html.ValidationMessageFor(m => m.UserModel.Email)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td width="50%">
                        <div class="editor-label">
                            (*) @Html.LabelFor(m => m.User_I.idRol)
                        </div>
                        <div class="editor-field">
                            @Html.DropDownList("idRol") 
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(m => m.User_I.career)
                        </div>
                        <div class="editor-field">
                            @Html.EditorFor(m => m.User_I.career)<br />
                            @Html.ValidationMessageFor(m => m.User_I.career)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(m => m.User_I.zone)
                        </div>
                        <div class="editor-field">
                            @Html.EditorFor(m => m.User_I.zone)<br />
                            @Html.ValidationMessageFor(m => m.User_I.zone)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(m => m.User_I.school)
                        </div>
                        <div class="editor-field">
                            @Html.EditorFor(m => m.User_I.school)<br />
                            @Html.ValidationMessageFor(m => m.User_I.school)
                        </div>
                    </td>
                </tr>
            </table>
    </fieldset>
    <fieldset>
            <legend>Datos del Representante</legend><br />
                <table width= "100%">
                    <tr>
                        <td>
                            <div class="editor-label">
                                (*) @Html.LabelFor(m => m.User_I.parent_name)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.parent_name)<br />
                                @Html.ValidationMessageFor(m => m.User_I.parent_name)
                            </div>
                        </td>
                        <td>
                            <div class="editor-label">
                                (*) @Html.LabelFor(m => m.User_I.parent_last_name)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.parent_last_name)<br />
                                @Html.ValidationMessageFor(m => m.User_I.parent_last_name)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td width="50%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.parent_cedula)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.parent_cedula)<br />
                                @Html.ValidationMessageFor(m => m.User_I.parent_cedula)
                            </div>
                        </td>
                        <td>
                            <div class="editor-label">
                                (*) @Html.LabelFor(m => m.User_I.parent_phone)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.parent_phone)<br />
                                @Html.ValidationMessageFor(m => m.User_I.parent_phone)
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="editor-label">
                                (*)@Html.LabelFor(m => m.User_I.parent_email)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.parent_email)<br />
                                @Html.ValidationMessageFor(m => m.User_I.parent_email)
                            </div>
                        </td>
                        <td>

                        </td>
                    </tr>
                </table>
        </fieldset>
        <fieldset>
            <legend>Datos de la Inscripción</legend><br />
                <table width= "100%">
                    <tr>
                        <td>
                            <div class="editor-label">
                                (*) @Html.LabelFor(m => m.User_I.idTurno)
                            </div>
                            <div class="editor-field">
                                @Html.DropDownList("idTurno")<br /> 
                            </div>
                        </td>
                        <td>
                            <div class="editor-label">
                                (*) @Html.LabelFor(m => m.User_I.idSede)
                            </div>
                            <div class="editor-field">
                                @Html.DropDownList("idSede")<br /> 
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="editor-label">
                                (*) @Html.LabelFor(m => m.User_I.idModoPago)
                            </div>
                            <div class="editor-field">
                                @Html.DropDownList("idModoPago")<br /> 
                            </div>
                        </td>
                        <td>
                            <div class="editor-label">
                                (*) @Html.LabelFor(m => m.User_I.n_cuotas_pago)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.n_cuotas_pago) /  @ViewBag.CuotasPendientes  @if(Model.User_I.idStatus ==1){ <div class="error" style="display:inline;"> * Por Revisar</div>}
                                @Html.ValidationMessageFor(m => m.User_I.n_cuotas_pago)
                            </div>
                        </td>
                    </tr>
               </table>
        </fieldset>
        <fieldset>
            <legend>Pago de Cuotas</legend><br />
               <table width= "100%">
                    <tr>
                         <td width="25%">
                             <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.idFormaPago)
                            </div>
                            <div class="editor-field">
                                @Html.DropDownList("idFormaPago")<br /> 
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.n_transaction)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.n_transaction)
                                @Html.ValidationMessageFor(m => m.User_I.n_transaction)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.transactionDate)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.transactionDate)
                                @Html.ValidationMessageFor(m => m.User_I.transactionDate)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.verificado)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.verificado)
                                @Html.ValidationMessageFor(m => m.User_I.verificado)
                            </div>
                        </td>
                    </tr>
                     @if (Model.User_I.n_transaction02 != null)
                     {
                    <tr>
                         <td width="25%">
                             <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.idFormaPago02)
                            </div>
                            <div class="editor-field">
                                @Html.DropDownList("idFormaPago02")<br /> 
                            </div>
                        </td>
                          <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.n_transaction02)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.n_transaction02)
                                @Html.ValidationMessageFor(m => m.User_I.n_transaction02)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.transactionDate02)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.transactionDate02)
                                @Html.ValidationMessageFor(m => m.User_I.transactionDate02)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.verificado02)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.verificado02)
                                @Html.ValidationMessageFor(m => m.User_I.verificado02)
                            </div>
                        </td>
                    </tr>
                     } else { @Html.DropDownList("idFormaPago02", null, new { @class = "hidden"  })  }

                     @if (Model.User_I.n_transaction03 != null)
                     {
                    <tr>
                         <td width="25%">
                             <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.idFormaPago03)
                            </div>
                            <div class="editor-field">
                                @Html.DropDownList("idFormaPago03")<br /> 
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.n_transaction03)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.n_transaction03)
                                @Html.ValidationMessageFor(m => m.User_I.n_transaction03)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.transactionDate03)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.transactionDate03)
                                @Html.ValidationMessageFor(m => m.User_I.transactionDate03)
                            </div>
                        </td>
                         <td width="25%">
                            <div class="editor-label">
                                @Html.LabelFor(m => m.User_I.verificado03)
                            </div>
                            <div class="editor-field">
                                @Html.EditorFor(m => m.User_I.verificado03)
                                @Html.ValidationMessageFor(m => m.User_I.verificado03)
                            </div>
                        </td>
                    </tr>
                     } else { @Html.DropDownList("idFormaPago03", null, new { @class = "hidden"  })  }
                </table>
        </fieldset>
        <fieldset>
            <legend>Datos de Recomendación</legend><br />
                <table width= "100%">   
                    <tr>
                        <td>
                            <div class="editor-label"> 
                                    @Html.LabelFor(m => m.User_I.recomendado)</div>
                            <div class="editor-field">
                                    @Html.EditorFor(m => m.User_I.recomendado)
                            </div>
                        </td>
                    </tr>
                </table>
        </fieldset>
        <fieldset>
            <legend>Datos de Cuenta</legend><br />
                <table width= "100%">
                    <tr>
                        <td>
                            <div class="editor-label"> 
                                @Html.LabelFor(m => m.UserModel.CreationDate)</div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.UserModel.CreationDate)
                                @Html.ValidationMessageFor(model => model.UserModel.CreationDate)
                            </div>
                        </td>
                        <td>
                            <div class="editor-label">
                                @Html.LabelFor(m => m.UserModel.LastLoginDate)</div>
                            <div class="editor-field">
                                @Html.EditorFor(model => model.UserModel.LastLoginDate)
                                @Html.ValidationMessageFor(model => model.UserModel.LastLoginDate)
                            </div> 
                        </td>
                    </tr>
                    <tr>
                        <td width= "50%">
                            <div class="editor-label"> <b>Status de Aprobación</b></div>
                            <div class="editor-field">
                                    @if (Model.UserModel.IsApproved.ToString() == "False")
                                    {
                                        <div>Bloqueado</div>
                                    }
                                    else
                                    {
                                        <div>Activo</div>
                                    }
                            </div> 
                        </td>
                        <td>

                        </td>
                    </tr>
                </table>
        </fieldset>

        <p>
            <input type="submit" value="Salvar" />
        </p>
}

<div>
    @Html.ActionLink("Menú Anterior", "SearchIndex")
</div>
